var express = require('express');
var router = express.Router();

router.get('/', function(req, res, next) {
    res.render('newsletter-signup', { title: 'Newsletter Signup' });
});

router.post('/signup', function(req, res, next) {
    console.log('name: ' + req.body.name);
    console.log('email: ' + req.body.email);
    res.redirect(303, '/newsletter/thank-you');
});

router.get('/thank-you', function(req, res, next) {
    res.render('newsletter-thank-you', { title: 'Thank You' });
})

module.exports = router;